<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Document</title>
</head>
<body>
<div id="mess" style="display: none" >
    ${msg!"欢迎登录"}
</div>
<form action="/loginck" method="post">

    <label for="ename">请输入登录用户名:</label>
    <input type="text" id="ename" name="ename" required>
    <br>
    <input type="submit" id="btn" value="提交">


</form>
<#--<script>
    function submitForm() {
        var formData = new FormData(document.querySelector('form'));
        fetch('/loginck', {
            method: 'POST',
            body: formData
        })
            .then(response => response.json())
            .then(data => {
                alert(data.message); // 展示操作结果的alert
            })
            .catch(error => {
                console.error('Error:', error);
                alert('请求失败，请稍后重试');
            });
        return false; // 阻止表单的默认提交行为
    }

</script>-->
<script>
    addEventListener('load',function (){
        var n = document.getElementById("mess").innerHTML;
            alert(n);

    })

</script>
</body>
</html>